package co.yixiang.modules.shop.repository;

import co.yixiang.modules.shop.domain.YxInvestPackage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

/**
 * @author frq
 * @date 2020-05-20
 */
public interface YxInvestPackageRepository extends JpaRepository<YxInvestPackage, String>, JpaSpecificationExecutor<YxInvestPackage> {
    @Query(value = "select yxi.id as address,yxi.name as value  from yx_invest_package yxi " +
            "INNER JOIN yx_invest_package_product yxp ON yxi.id = yxp.package_id " +
            "where yxi.is_del=0", nativeQuery = true)
    List<Map<String,Object>> findListAll();
}
